package com.allin.social.util;

import com.allin.http.callback.ResultCallback;
import com.squareup.okhttp.Request;

/**
 * Description:
 *
 * @author: guoyongping
 * @date: 2016/4/13 20:12
 */
public abstract class MyBaseHttpRequestCallback <T extends BaseResponseObject> extends ResultCallback<T>{

    @Override
    public void onError(Request request, Exception e) {

    }

    @Override
    public void onResponse(T response) {

        boolean status = response.getResponseStatus();

        if (status){
            onLogicSuccess(response);
        }else {
            onLogicFailure(response);
        }
    }


    public abstract void onLogicSuccess(T t);

    public abstract void onLogicFailure(T t) ;
}
